package unq.uis.robots.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import unq.uis.robots.applicationsModels.VenderRobotApplicationModel;

@SuppressWarnings("serial")
public class RetornarDeVentaServlet extends HttpServlet{
	
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {		
		VenderRobotApplicationModel venderRobotApplicationModel = (VenderRobotApplicationModel)request.getSession().getAttribute("vender");		
		venderRobotApplicationModel.vender();		
		
		request.getRequestDispatcher("jugador.jsp").forward(request, response);		
	}	
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {		
		VenderRobotApplicationModel venderRobotApplicationModel = (VenderRobotApplicationModel)request.getSession().getAttribute("vender");		
		venderRobotApplicationModel.rechazarOferta();
		
		request.getRequestDispatcher("jugador.jsp").forward(request, response);		
	}	

}
